package com.heima.it.manager.entry;

import com.heima.it.manager.domain.Teacher;

import java.util.ArrayList;
import java.util.Scanner;

public class TeacherManager {
    private static Scanner scanner = new Scanner(System.in);
    private static ArrayList<Teacher> arrayList = new ArrayList<Teacher>();

    public static void main(String[] args) {
        Teacher t = new Teacher("1", "1", "1", "1");
        Teacher t1 = new Teacher("2", "2", "2", "2");
        Teacher t2 = new Teacher("3", "3", "3", "3");
        Teacher t3 = new Teacher("3", "3", "3", "3");
        Teacher t4 = new Teacher("3", "3", "3", "3");
        arrayList.add(t);
        arrayList.add(t1);
        arrayList.add(t2);
        arrayList.add(t3);
        arrayList.add(t4);
        String username = "1";
        String password = "1";
        for (int j = 1; j <= 3; j++) {

            String username1;
            String password1;
            System.out.println("----欢迎来到5楼后台管理系统----");
            System.out.println("请" + j + "次输入用户名：");
            username1 = scanner.next();
            System.out.println("请" + j + "次输入密码：");
            password1 = scanner.next();
            //判断用户名密码是否正确
            if (username1.equals(username) && password1.equals(password)) {
                System.out.println("密码正确");
                home();
            } else {
                System.out.println("输入错误,请重新输入：");
            }
            //  System.out.println("逻辑判断");
            //用户密码正确，提示输入正确，执行home方法

            //用户密码输入错误，提示错误，重新输入
        }

        // 数据信息


    }

    public static void home() {
        System.out.println("--------------------------");
        System.out.println("-欢迎XX进入5楼后台管理系统-");
        System.out.println("---------------------------");
        System.out.println("根据对应序号进行选择：");
        System.out.println("1.添加老师");
        System.out.println("2.删除老师");
        System.out.println("3.修改老师");
        System.out.println("4.查询老师");
        System.out.println("5.统计操作");
        System.out.println("6.退出");
        System.out.println("请输入你的选择：");
        //进入系统后选择操作
        while (true) {
            switch (scanner.next()) {
                case "1":
                    System.out.println("添加教师");
                    break;
                case "2":
                    System.out.println("删除教师");
                    break;
                case "3":
                    System.out.println("修改教师");
                    break;
                case "4":
                    System.out.println("查询教师");
                    break;
                case "5":
                    System.out.println("统计操作");
                    break;
                case "6":
                    System.out.println("退出");
                    System.exit(0);
                    break;
                default:
                    System.out.println("有异常");
                    break;
            }
        }
    }
}

